<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    1064. Smallest Integer Divisible by K
   </h1>
   <p>
    Given a positive integer
    <code>
     K
    </code>
    , you need find the
    <strong>
     smallest
    </strong>
    &nbsp;positive integer
    <code>
     N
    </code>
    such that
    <code>
     N
    </code>
    is divisible by
    <code>
     K
    </code>
    , and
    <code>
     N
    </code>
    only contains the digit
    <strong>
     1
    </strong>
    .
   </p>
   <p>
    Return the&nbsp;length of
    <code>
     N
    </code>
    .&nbsp; If there is no such
    <code>
     N
    </code>
    ,&nbsp;return -1.
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 1
<strong>Output:</strong> 1
<strong>Explanation:</strong> The smallest answer is N = 1, which has length 1.</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 2
<strong>Output:</strong> -1
<strong>Explanation:</strong> There is no such positive integer N divisible by 2.</pre>
   <p>
    <strong>
     Example 3:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 3
<strong>Output:</strong> 3
<strong>Explanation:</strong> The smallest answer is N = 111, which has length 3.</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     Note:
    </strong>
   </p>
   <ul>
    <li>
     <code>
      1 &lt;= K &lt;= 10^5
     </code>
    </li>
   </ul>
  </div>
  <div>
   <h1 class="question_title">
    1064. 可被 K 整除的最小整数
   </h1>
   <p>
    给定正整数&nbsp;
    <code>
     K
    </code>
    ，你需要找出可以被 K 整除的、仅包含数字
    <strong>
     1
    </strong>
    的最小正整数 N。
   </p>
   <p>
    返回&nbsp;
    <code>
     N
    </code>
    &nbsp;的长度。如果不存在这样的&nbsp;
    <code>
     N
    </code>
    ，就返回
    <code>
     -1
    </code>
    。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入：</strong>1
<strong>输出：</strong>1
<strong>解释：</strong>最小的答案是 N = 1，其长度为 1。</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <pre><strong>输入：</strong>2
<strong>输出：</strong>-1
<strong>解释：</strong>不存在可被 2 整除的正整数 N 。</pre>
   <p>
    <strong>
     示例 3：
    </strong>
   </p>
   <pre><strong>输入：</strong>3
<strong>输出：</strong>3
<strong>解释：</strong>最小的答案是 N = 111，其长度为 3。</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ul>
    <li>
     <code>
      1 &lt;= K &lt;= 10^5
     </code>
    </li>
   </ul>
  </div>
 </body>
</html>